<div class="panel panel-default panel-intro">
    {:build_heading()}

    <div class="panel-body">
        <div id="myTabContent" class="tab-content">
            <div class="tab-pane fade active in" id="one">
                <div class="widget-body no-padding">
                    <div id="toolbar" class="toolbar">
                        <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
                        <a href="javascript:;" class="btn btn-success btn-add {:$auth->check('caijiaku/material_inventory_temp/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
                        <a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('caijiaku/material_inventory_temp/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
                        <a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('caijiaku/material_inventory_temp/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
                        <!-- <a href="javascript:;" class="btn btn-danger {:$auth->check('caijiaku/material_inventory_temp/importformal')?'':'hide'}" title="{:__('批量导入正式库')}" id="btn-import-formal" ><i class="fa fa-upload"></i> {:__('批量导入正式库')}</a> -->

                        <a href="javascript:;" class="btn btn-success btn-projectedit {:$auth->check('caijiaku/material_inventory_temp/projectedit')?'':'hide'}" title="{:__('按项目编辑')}" ><i class="fa fa-pencil"></i> {:__('按项目编辑')}</a>
                        <div class="dropdown btn-group {:$auth->check('caijiaku/material_inventory_temp/importformal')?'':'hide'}">
                            <a class="btn btn-primary btn-more dropdown-toggle " data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('批量导入正式库')}</a>
                            <ul class="dropdown-menu text-left" role="menu">
                                <li><a class="btn btn-link btn-disabled disabled" href="javascript:;" id="importSelect"> {:__('当前页选中数据')}</a></li>
                                <li><a class="btn btn-link " href="javascript:;" id="importProject"> {:__('按项目及类别筛选')}</a></li>
                            </ul>
                        </div>
                        <a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('caijiaku/material_inventory_temp/recyclebin')?'':'hide'}" href="caijiaku/material_inventory_temp/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
                    </div>
                    <table id="table" class="table table-striped table-bordered table-hover table-nowrap"
                           data-operate-edit="{:$auth->check('caijiaku/material_inventory_temp/edit')}"
                           data-operate-del="{:$auth->check('caijiaku/material_inventory_temp/del')}"
                           width="100%">
                    </table>
                </div>
            </div>

        </div>
    </div>
</div>
<script id="customformtpl" type="text/html">
    <!--form表单必须添加form-commsearch这个类-->
    <form action="" class="form-commonsearch">
        <div style="border-radius:2px;margin-bottom:10px;background:#f5f5f5;padding:15px 20px;">
            <div class="row" id="one-cate">
                <div class="form-group col-xs-12 col-sm-12 col-md-12">
                    <label class="control-label  col-xs-1">一级分类</label>
                    <div class="input-group col-xs-11">
                        <div class="radio">
                        {foreach name="category" item="vo"}
                        <label for="category1-{$vo.id}" data-id="{$vo.id}" >
                            <input id="category1-{$vo.id}" name="category1" type="radio" value="{$vo.id}">
                            {$vo.name}
                        </label>
                        {/foreach}
                        </div>
                    </div>
                </div>
            </div>
            <div class="row hide" id="two-cate">
                <div class="form-group col-xs-12 col-sm-12 col-md-12">
                    <label class="control-label col-xs-1">二级分类</label>
                    <div class="input-group col-xs-11"></div>
                </div>
            </div>
            <div class="row hide" id="three-cate">
                <div class="form-group col-xs-12 col-sm-12 col-md-12">
                    <label class="control-label col-xs-1">三级分类</label>
                    <div class="input-group col-xs-11"></div>
                </div>
            </div>
            <div class="row hide" id="four-cate">
                <div class="form-group col-xs-12 col-sm-12 col-md-12">
                    <label class="control-label col-xs-1">四级分类</label>
                    <input class="operate" type="hidden" data-name="material_id" value="="/>
                    <div class="input-group col-xs-11"></div>
                </div>
            </div>
            <div class="row">
                <div class="form-group col-xs-12 col-sm-6 col-md-3">
                    <label class="control-label col-xs-4">项目名称</label>
                    <!--隐式的operate操作符，必须携带一个class为operate隐藏的文本框,且它的data-name="字段",值为操作符-->
                    <input class="operate" type="hidden" data-name="project_name" value="LIKE"/>
                    <div class="col-xs-8">
                    <input class="form-control" type="text" name="project_name" placeholder="请输入查找的项目名称" value=""/>
                    </div>
                </div>
                <div class="form-group col-xs-12 col-sm-6 col-md-3">
                    <label class="control-label col-xs-4">材料名称</label>
                    <!--隐式的operate操作符，必须携带一个class为operate隐藏的文本框,且它的data-name="字段",值为操作符-->
                    <input class="operate" type="hidden" data-name="title" value="LIKE"/>
                    <div class="col-xs-8">
                    <input class="form-control" type="text" name="title" placeholder="请输入查找的材料名称" value=""/>
                    </div>
                </div>
                <div class="form-group col-xs-12 col-sm-6 col-md-3">
                    <label class="control-label col-xs-4">材机类别</label>
                    <!--隐式的operate操作符，必须携带一个class为operate隐藏的文本框,且它的data-name="字段",值为操作符-->
                    <input class="operate" type="hidden" data-name="catename" value="="/>
                    <div class="col-xs-8">
                    <input class="form-control selectpage" type="text" name="catename" data-source="caijiaku/material_inventory_temp/catelist" data-field="catename" data-search-field="catename" data-primary-key="catename" placeholder="请输入查找的材机类别" value=""/>
                    </div>
                </div>
                <div class="form-group col-xs-12 col-sm-6 col-md-3">
                    <label class="control-label col-xs-4">数据来源</label>
                    <div class="col-xs-8">
                        <input class="operate" type="hidden" data-name="admin_id" value="="/>
                        <input type="text" data-source="caijiaku/material_inventory/getsource" data-field="nickname" data-primary-key="id" data-pagination="false" class="form-control selectpage" name="admin_id" value=""/>
                    </div>
                </div>
                <div class="form-group col-xs-12 col-sm-6 col-md-3">
                    <label class="control-label col-xs-4">是否导入</label>
                    <!--隐式的operate操作符，必须携带一个class为operate隐藏的文本框,且它的data-name="字段",值为操作符-->
                    <input class="operate" type="hidden" data-name="isimport" value="="/>
                    <div class="col-xs-8">
                        <select class="form-control" name="isimport">
                            <option value="">请选择</option>
                            <option value="1">是</option>
                            <option value="0" selected>否</option>
                        </select>
                    </div>
                </div>
                <div class="form-group col-xs-12 col-sm-6 col-md-3">
                        <label class="control-label col-xs-4">创建时间</label>
                        <input type="hidden" class="operate" data-name="createtime" value="RANGE"/>
                        <div class="col-xs-8">
                        <input type="text" class="form-control datetimerange" name="createtime" value=""/>
                        </div>
                </div>
                <div class="form-group col-xs-12 col-sm-6 col-md-3">
                    <div class="row">
                        <div class="col-xs-6">
                            <input type="submit" class="btn btn-success btn-block" value="提交"/>
                        </div>
                        <div class="col-xs-6">
                            <input type="reset" class="btn btn-primary btn-block" value="重置"/>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
</script>
<style>
    .form-commonsearch .radio{
        margin-top: 0px;
    }
    .form-commonsearch .radio > label{
        margin-right: 10px;
        padding: 0 9px;
        border-radius: 4px;
        /* border: 1px solid #ccc; */
        box-sizing: border-box;
    }
    .form-commonsearch .radio input[type="radio"], .radio-inline input[type="radio"], .checkbox input[type="checkbox"], .checkbox-inline input[type="checkbox"] {
        opacity: 0;
        outline: 0;
        position: absolute;
        z-index: -1;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        margin: 0;
    }
    .form-commonsearch .radio > label.selected {
        /* border: 1px solid #18bc9c; */
        background-color: #18bc9c;
        color: #fff;
    }
    .form-commonsearch .row > .form-group{
        margin-bottom: 5px;
    }
    .table-header-wrap {
        white-space: pre-line;
    }
</style>